package com.bbs.util;

public class ChangeUtil {

	/**
	 * 把String转换为int，如果s不是数字则返回0
	 * @param s
	 * @return
	 */
	@SuppressWarnings("finally")
	public int changeStringToInt(String s) {
		int i = 0;;
		if(s == null) {
			i = 1;
			return i;
		} else {
			try {
				i = Integer.valueOf(s);
			} catch (NumberFormatException e) {
			} finally {
				return i;
			}
		}
		
	}
	
}
